Skip to content

[4/8] initdata-processor: support insecure platforms#2354

Open
msanft wants to merge 3 commits into
mainfrom
split/pr-2337-initdata
Open

[4/8] initdata-processor: support insecure platforms#2354
msanft wants to merge 3 commits into
mainfrom
split/pr-2337-initdata

Conversation

@msanft

@msanft msanft commented Apr 27, 2026

Copy link
Copy Markdown
Member

Split from #2337 as part of a stacked review series.

Depends on: #2353

This PR teaches the initdata-processor how to operate on insecure platforms:

  • skip TEE digest validation when no TEE platform is present
  • serve hostdata for insecure attestation
  • switch the service unit to notify mode for the long-running insecure case

@msanft msanft added the no changelog PRs not listed in the release notes label Apr 27, 2026
@msanft msanft force-pushed the split/pr-2337-initdata branch from d983852 to a96709b Compare April 27, 2026 13:27
@msanft msanft requested a review from burgerdev April 27, 2026 13:29
@msanft msanft changed the title initdata-processor: support insecure platforms [3/8] initdata-processor: support insecure platforms Apr 27, 2026
@msanft msanft force-pushed the split/pr-2337-attestation branch from 35fd8b4 to abcf97e Compare April 27, 2026 16:17
@msanft msanft force-pushed the split/pr-2337-initdata branch from a96709b to 61b512e Compare April 27, 2026 16:17
Comment thread initdata-processor/main.go Outdated
@msanft msanft force-pushed the split/pr-2337-attestation branch from abcf97e to d555ab0 Compare April 29, 2026 10:27
Base automatically changed from split/pr-2337-attestation to main April 29, 2026 10:55
@msanft msanft force-pushed the split/pr-2337-initdata branch from 61b512e to e3d60c2 Compare April 29, 2026 10:59
@msanft msanft requested a review from burgerdev April 29, 2026 10:59
@msanft msanft force-pushed the split/pr-2337-initdata branch from e3d60c2 to 27c226a Compare April 29, 2026 11:13

@burgerdev burgerdev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly lgtm

Comment thread internal/initdata/initdata.go Outdated
@msanft msanft force-pushed the split/pr-2337-initdata branch from 27c226a to 934583d Compare May 4, 2026 07:10
@msanft msanft requested a review from burgerdev May 4, 2026 07:10

@burgerdev burgerdev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, this does not work with initdata: An attacker can launch the VM with TEE support and set HOSTDATA to their desired value, but supply an initdata file that includes Insecure. HOSTDATA is now unvalidated, but still shows in reports.

The previous version was arguably safer, but safe enough? idk.

@msanft msanft force-pushed the split/pr-2337-initdata branch from 934583d to 72898ef Compare May 5, 2026 12:55
@msanft msanft changed the title [3/8] initdata-processor: support insecure platforms [4/8] initdata-processor: support insecure platforms May 5, 2026
@msanft msanft changed the base branch from main to split/pr-2337-runtime-nodeinstaller May 5, 2026 12:57
@msanft msanft force-pushed the split/pr-2337-initdata branch from 72898ef to f2897e6 Compare May 6, 2026 09:56
@msanft msanft force-pushed the split/pr-2337-runtime-nodeinstaller branch 2 times, most recently from dda6dc2 to d1e13e3 Compare May 6, 2026 11:55
@msanft msanft force-pushed the split/pr-2337-initdata branch 2 times, most recently from 91b1df7 to db7cd22 Compare May 6, 2026 12:00
@msanft msanft force-pushed the split/pr-2337-runtime-nodeinstaller branch from d1e13e3 to 70e5da4 Compare May 6, 2026 12:00
@msanft msanft force-pushed the split/pr-2337-initdata branch from db7cd22 to a8f6eb6 Compare May 6, 2026 12:27
@msanft msanft force-pushed the split/pr-2337-runtime-nodeinstaller branch 2 times, most recently from 056e110 to 9f047ca Compare May 11, 2026 20:39
@msanft msanft force-pushed the split/pr-2337-initdata branch 2 times, most recently from fd0d094 to bbf67f4 Compare May 11, 2026 20:47
@msanft msanft force-pushed the split/pr-2337-runtime-nodeinstaller branch 2 times, most recently from 5fa6e62 to 6c99247 Compare May 12, 2026 07:31
Base automatically changed from split/pr-2337-runtime-nodeinstaller to main May 12, 2026 11:00
@msanft msanft force-pushed the split/pr-2337-initdata branch 4 times, most recently from 4e3d618 to c168265 Compare May 12, 2026 14:59
@msanft msanft requested a review from burgerdev May 12, 2026 15:01

@charludo charludo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just have one nit, LGTM otherwise.

Comment thread initdata-processor/main.go Outdated
@msanft msanft force-pushed the split/pr-2337-initdata branch 6 times, most recently from 62ac3e2 to 9d6a048 Compare May 26, 2026 08:48

@burgerdev burgerdev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just a nit and a squash

Comment thread nodeinstaller/internal/kataconfig/config.go Outdated
Comment thread initdata-processor/main.go
@msanft msanft force-pushed the split/pr-2337-initdata branch from 9d6a048 to 9b08076 Compare June 5, 2026 13:57
@msanft msanft force-pushed the split/pr-2337-initdata branch from 9b08076 to f13a5d2 Compare June 5, 2026 17:47

@sespiros sespiros left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, an inline comment and some others that I had looking at the merged PRs so far, so feel free to incorporate as you see fit here/in one of the upcoming PRs/follow-ups:

log.Printf("hostdata server shutdown error: %v", err)
}
}()
if err := server.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This came up during AI review, all incoming connections to the guest are disabled in:

ExecStart = "${pkgs.iptables}/bin/iptables-legacy -I INPUT -m conntrack ! --ctstate ESTABLISHED,RELATED -j DROP";

so I assume connections to the service will be dropped by default when service mesh is enabled. Service mesh seems relevant for the benchmarking use case (comparing across CC vs non-CC needs the same proxy/iptables stack I assume), but not sure if that combination is actually in scope here.

It seems it is (also afaict nothing in https://github.com/edgelesssys/contrast/blob/main/internal/kuberesource/mutators.go stops you from using service mesh with an insecure pod).

So depending on what we need here we either have to have a rule that allows this connection or refuse enabling the service mesh when an insecure platform is detected during generate (by catching that in the mutators).

@msanft

msanft commented Jun 10, 2026

Copy link
Copy Markdown
Member Author

Shouldn't we rename these to something more fitting like configuration-qemu-bm.toml?

I explicitly opted not to do so, since we want the insecure runtimes to reflect the CC versions as closely as possible, to allow easy performance benchmarking, for example. We do want the platform-specific kernel, etc., for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog PRs not listed in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants